
import request from '@/utils/request'
import qs from 'qs'

export const contractList = (search) => 
   request({
		url: '/op/contract_tpl/get_contract_tpl_list',
        method: 'get',
        params: {
            pageSize: search.limit,
            keyWord: search.name,
            pageNo:search.currentPage,
            dirCode:search.dirCode

        }   
	})

//保存文件夹
export  const  saveFile_folder =(data,dirCode) =>
    request({
        
        url: '/op/contract_tpl/create_contract_tpl_dir',
        method: 'post',
        data: JSON.stringify({
            name:data.name,
            dirCode
        })
    })

//保存文件
export  const  saveFile = (fileCode,name,dirCode)=>
    request({
        url: '/op/contract_tpl/create_contract_tpl',
        method: 'post',
        data: JSON.stringify({
            fileCode,
            name,
            dirCode
        })
    })

//修改文件夹
export  const  modify_folder  =  (data) =>
    request({
        url: '/op/contract_tpl/modify_contract_tpl_dir',
        method: 'post',
        data: JSON.stringify({
            code:data.code,
            name:data.name,
            
        })
    })
//修改文件
export  const   modify_file  =(data) =>
    request({
        url: '/op/contract_tpl/modify_contract_tpl',
        method: 'post',
        data: JSON.stringify({
            code:data.code,
            name:data.name,
            
        })
    })


//删除文件夹
export const  deleteFolder  =  (code) =>
    request({
        
        url: '/op/contract_tpl/delete_contract_tpl_dir',
        method: 'get',
        params:{
            code
        }
    })

export  const  deleteFile  =  (code) =>
    request({
        
        url: '/op/contract_tpl/delete_contract_tpl',
        method: 'get',
        params:{
            code
        }
    })
    
export  const  DetailFile  = (code)  =>
    request({
         url: '/op/contract_tpl/get_contract_tpl',
        method: 'get',
        params:{
            code
        }
    }) 
